home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 September / PCWorld_2008-09_cd.bin / v cisle / sadanastroju / wot-20080519-fx.xpi / chrome / wot.jar / skin / include / sample.js < prev    next >
Text File  |  2007-11-11  |  928b  |  36 lines

  1. var popup_area_height = 214;
  2. var popup_rating_height = 52;
  3.  
  4. function sample_load()
  5. {
  6.     if (!window.location.search) {
  7.         return;
  8.     }
  9.  
  10.     if (window.location.search.indexOf('negative') >= 0) {
  11.         $$('.r5').each(function(item, i) {
  12.                 item.removeClass('rating');
  13.             });
  14.         $$('.r4').each(function(item, i) {
  15.                 item.removeClass('rating');
  16.             });
  17.     }
  18.  
  19.     if (window.location.search &&
  20.             window.location.search.indexOf('popup') >= 0) {
  21.         var offset = 0;
  22.         var last = 'r0';
  23.         [ 'r1', 'r2', 'r4' ].each(function(item, i) {
  24.                 if (window.location.search.indexOf(item) >= 0) {
  25.                     $('wot-' + item + '-stack').setStyle('display', 'none');
  26.                     offset += popup_rating_height;
  27.                 } else {
  28.                     last = item;
  29.                 }
  30.             });
  31.         $('wot-' + last + '-stack').setStyle('border-bottom', 0);
  32.         $('wot-ratings').setStyle('height', (popup_area_height - offset) + 'px');
  33.         $('wot-layer').setStyle('display', 'block');
  34.     }
  35. }
  36.